﻿using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Threading;
#if !WINDOWS_PHONE
using System.Threading.Tasks;
#endif

namespace System.Reactive.Linq
{
	public static partial class Observable
	{
		public static IObservable<TSource> Finally<TSource>(this IObservable<TSource> source, Action finallyAction)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(finallyAction != null, null, "finallyAction != null");
			Contract.Ensures(Contract.Result<IObservable<TSource>>() != null, null, "Contract.Result<IObservable<TSource>>() != null");
			return null;
		}

		public static TSource First<TSource>(this IObservable<TSource> source)
		{
			Contract.Requires(source != null, null, "source != null");
			return default(TSource);
		}

		public static TSource First<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(predicate != null, null, "predicate != null");
			return default(TSource);
		}

		public static IObservable<TSource> FirstAsync<TSource>(this IObservable<TSource> source)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Ensures(Contract.Result<IObservable<TSource>>() != null, null, "Contract.Result<IObservable<TSource>>() != null");
			return null;
		}

		public static IObservable<TSource> FirstAsync<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(predicate != null, null, "predicate != null");
			Contract.Ensures(Contract.Result<IObservable<TSource>>() != null, null, "Contract.Result<IObservable<TSource>>() != null");
			return null;
		}

		public static TSource FirstOrDefault<TSource>(this IObservable<TSource> source)
		{
			Contract.Requires(source != null, null, "source != null");
			return default(TSource);
		}

		public static TSource FirstOrDefault<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(predicate != null, null, "predicate != null");
			return default(TSource);
		}

		public static IObservable<TSource> FirstOrDefaultAsync<TSource>(this IObservable<TSource> source)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Ensures(Contract.Result<IObservable<TSource>>() != null, null, "Contract.Result<IObservable<TSource>>() != null");
			return null;
		}

		public static IObservable<TSource> FirstOrDefaultAsync<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(predicate != null, null, "predicate != null");
			Contract.Ensures(Contract.Result<IObservable<TSource>>() != null, null, "Contract.Result<IObservable<TSource>>() != null");
			return null;
		}

		public static IObservable<TResult> For<TSource, TResult>(IEnumerable<TSource> source, Func<TSource, IObservable<TResult>> resultSelector)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(resultSelector != null, null, "resultSelector != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static void ForEach<TSource>(this IObservable<TSource> source, Action<TSource> onNext)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(onNext != null, null, "onNext != null");
		}

		public static void ForEach<TSource>(this IObservable<TSource> source, Action<TSource, int> onNext)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(onNext != null, null, "onNext != null");
		}

#if !WINDOWS_PHONE
		public static Task ForEachAsync<TSource>(this IObservable<TSource> source, Action<TSource> onNext)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(onNext != null, null, "onNext != null");
			Contract.Ensures(Contract.Result<Task>() != null, null, "Contract.Result<Task>() != null");
			return null;
		}

		public static Task ForEachAsync<TSource>(this IObservable<TSource> source, Action<TSource, int> onNext)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(onNext != null, null, "onNext != null");
			Contract.Ensures(Contract.Result<Task>() != null, null, "Contract.Result<Task>() != null");
			return null;
		}

		public static Task ForEachAsync<TSource>(this IObservable<TSource> source, Action<TSource> onNext, CancellationToken cancellationToken)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(onNext != null, null, "onNext != null");
			Contract.Ensures(Contract.Result<Task>() != null, null, "Contract.Result<Task>() != null");
			return null;
		}

		public static Task ForEachAsync<TSource>(this IObservable<TSource> source, Action<TSource, int> onNext, CancellationToken cancellationToken)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(onNext != null, null, "onNext != null");
			Contract.Ensures(Contract.Result<Task>() != null, null, "Contract.Result<Task>() != null");
			return null;
		}
#endif

		public static IObservable<TSource[]> ForkJoin<TSource>(this IEnumerable<IObservable<TSource>> sources)
		{
			Contract.Requires(sources != null, null, "sources != null");
			//Contract.Requires(Contract.ForAll(sources, observable => observable != null), null, "Contract.ForAll(sources, observable => observable != null)");
			Contract.Ensures(Contract.Result<IObservable<TSource[]>>() != null, null, "Contract.Result<IObservable<TSource[]>>() != null");
			return null;
		}

		public static IObservable<TSource[]> ForkJoin<TSource>(params IObservable<TSource>[] sources)
		{
			Contract.Requires(sources != null, null, "sources != null");
			//Contract.Requires(Contract.ForAll(sources, observable => observable != null), null, "Contract.ForAll(sources, observable => observable != null)");
			Contract.Ensures(Contract.Result<IObservable<TSource[]>>() != null, null, "Contract.Result<IObservable<TSource[]>>() != null");
			return null;
		}

		public static IObservable<TResult> ForkJoin<TFirst, TSecond, TResult>(this IObservable<TFirst> first, IObservable<TSecond> second, Func<TFirst, TSecond, TResult> resultSelector)
		{
			Contract.Requires(first != null, null, "first != null");
			Contract.Requires(second != null, null, "second != null");
			Contract.Requires(resultSelector != null, null, "resultSelector != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

#if !WINDOWS_PHONE
		public static IObservable<TResult> FromAsync<TResult>(Func<Task<TResult>> functionAsync)
		{
			Contract.Requires(functionAsync != null, null, "functionAsync != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static IObservable<Unit> FromAsync(Func<Task> actionAsync)
		{
			Contract.Requires(actionAsync != null, null, "actionAsync != null");
			Contract.Ensures(Contract.Result<IObservable<Unit>>() != null, null, "Contract.Result<IObservable<Unit>>() != null");
			return null;
		}

		public static IObservable<TResult> FromAsync<TResult>(Func<CancellationToken, Task<TResult>> functionAsync)
		{
			Contract.Requires(functionAsync != null, null, "functionAsync != null");
			Contract.Ensures(Contract.Result<IObservable<TResult>>() != null, null, "Contract.Result<IObservable<TResult>>() != null");
			return null;
		}

		public static IObservable<Unit> FromAsync(Func<CancellationToken, Task> actionAsync)
		{
			Contract.Requires(actionAsync != null, null, "actionAsync != null");
			Contract.Ensures(Contract.Result<IObservable<Unit>>() != null, null, "Contract.Result<IObservable<Unit>>() != null");
			return null;
		}
#endif

		public static Func<IObservable<Unit>> FromAsyncPattern(Func<AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<IObservable<Unit>>>() != null, null, "Contract.Result<Func<IObservable<Unit>>>() != null");
			return null;
		}

		public static Func<IObservable<TResult>> FromAsyncPattern<TResult>(Func<AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<IObservable<TResult>>>() != null, null, "Contract.Result<Func<IObservable<TResult>>>() != null");
			return null;
		}

		public static Func<T1, IObservable<Unit>> FromAsyncPattern<T1>(Func<T1, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, IObservable<Unit>>>() != null, null, "Contract.Result<Func<T1, IObservable<Unit>>>() != null");
			return null;
		}

		public static Func<T1, IObservable<TResult>> FromAsyncPattern<T1, TResult>(Func<T1, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, IObservable<TResult>>>() != null, null, "Contract.Result<Func<T1, IObservable<TResult>>>() != null");
			return null;
		}

		public static Func<T1, T2, IObservable<Unit>> FromAsyncPattern<T1, T2>(Func<T1, T2, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, IObservable<Unit>>>() != null, null, "Contract.Result<Func<T1, T2, IObservable<Unit>>>() != null");
			return null;
		}

		public static Func<T1, T2, IObservable<TResult>> FromAsyncPattern<T1, T2, TResult>(Func<T1, T2, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, IObservable<TResult>>>() != null, null, "Contract.Result<Func<T1, T2, IObservable<TResult>>>() != null");
			return null;
		}

#if !WINDOWS_PHONE
		public static Func<T1, T2, T3, IObservable<Unit>> FromAsyncPattern<T1, T2, T3>(Func<T1, T2, T3, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, IObservable<Unit>>>() != null, null, "Contract.Result<Func<T1, T2, T3, IObservable<Unit>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, IObservable<TResult>> FromAsyncPattern<T1, T2, T3, TResult>(Func<T1, T2, T3, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, IObservable<TResult>>>() != null, null, "Contract.Result<Func<T1, T2, T3, IObservable<TResult>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, IObservable<Unit>> FromAsyncPattern<T1, T2, T3, T4>(Func<T1, T2, T3, T4, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, IObservable<Unit>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, IObservable<Unit>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, IObservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, TResult>(Func<T1, T2, T3, T4, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, IObservable<TResult>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, IObservable<TResult>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, IObservable<Unit>> FromAsyncPattern<T1, T2, T3, T4, T5>(Func<T1, T2, T3, T4, T5, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, IObservable<Unit>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, IObservable<Unit>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, IObservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, TResult>(Func<T1, T2, T3, T4, T5, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, IObservable<TResult>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, IObservable<TResult>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, IObservable<Unit>> FromAsyncPattern<T1, T2, T3, T4, T5, T6>(Func<T1, T2, T3, T4, T5, T6, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, IObservable<Unit>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, IObservable<Unit>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, IObservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, TResult>(Func<T1, T2, T3, T4, T5, T6, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, IObservable<TResult>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, IObservable<TResult>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, IObservable<Unit>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7>(Func<T1, T2, T3, T4, T5, T6, T7, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, IObservable<Unit>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, IObservable<Unit>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, IObservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, TResult>(Func<T1, T2, T3, T4, T5, T6, T7, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, IObservable<TResult>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, IObservable<TResult>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, T8, IObservable<Unit>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8>(Func<T1, T2, T3, T4, T5, T6, T7, T8, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, IObservable<Unit>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, IObservable<Unit>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, T8, IObservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, TResult>(Func<T1, T2, T3, T4, T5, T6, T7, T8, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, IObservable<TResult>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, IObservable<TResult>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, IObservable<Unit>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, IObservable<Unit>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, IObservable<Unit>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, IObservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, IObservable<TResult>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, IObservable<TResult>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, IObservable<Unit>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, IObservable<Unit>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, IObservable<Unit>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, IObservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, IObservable<TResult>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, IObservable<TResult>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, IObservable<Unit>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, IObservable<Unit>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, IObservable<Unit>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, IObservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, IObservable<TResult>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, IObservable<TResult>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, IObservable<Unit>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, IObservable<Unit>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, IObservable<Unit>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, IObservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, IObservable<TResult>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, IObservable<TResult>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, IObservable<Unit>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, IObservable<Unit>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, IObservable<Unit>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, IObservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TResult>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, IObservable<TResult>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, IObservable<TResult>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, IObservable<Unit>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, IObservable<Unit>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, IObservable<Unit>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, IObservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TResult>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
		{
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, IObservable<TResult>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, IObservable<TResult>>>() != null");
			return null;
		}
#endif

		public static IObservable<TEventArgs> FromEvent<TEventArgs>(Action<Action<TEventArgs>> addHandler, Action<Action<TEventArgs>> removeHandler)
		{
			Contract.Requires(addHandler != null, null, "addHandler != null");
			Contract.Requires(removeHandler != null, null, "removeHandler != null");
			Contract.Ensures(Contract.Result<IObservable<TEventArgs>>() != null, null, "Contract.Result<IObservable<TEventArgs>>() != null");
			return null;
		}

		public static IObservable<Unit> FromEvent(Action<Action> addHandler, Action<Action> removeHandler)
		{
			Contract.Requires(addHandler != null, null, "addHandler != null");
			Contract.Requires(removeHandler != null, null, "removeHandler != null");
			Contract.Ensures(Contract.Result<IObservable<Unit>>() != null, null, "Contract.Result<IObservable<Unit>>() != null");
			return null;
		}

		public static IObservable<TEventArgs> FromEvent<TDelegate, TEventArgs>(Action<TDelegate> addHandler, Action<TDelegate> removeHandler)
		{
			Contract.Requires(addHandler != null, null, "addHandler != null");
			Contract.Requires(removeHandler != null, null, "removeHandler != null");
			Contract.Ensures(Contract.Result<IObservable<TEventArgs>>() != null, null, "Contract.Result<IObservable<TEventArgs>>() != null");
			return null;
		}

		public static IObservable<TEventArgs> FromEvent<TDelegate, TEventArgs>(Func<Action<TEventArgs>, TDelegate> conversion, Action<TDelegate> addHandler, Action<TDelegate> removeHandler)
		{
			Contract.Requires(conversion != null, null, "conversion != null");
			Contract.Requires(addHandler != null, null, "addHandler != null");
			Contract.Requires(removeHandler != null, null, "removeHandler != null");
			Contract.Ensures(Contract.Result<IObservable<TEventArgs>>() != null, null, "Contract.Result<IObservable<TEventArgs>>() != null");
			return null;
		}

		public static IObservable<EventPattern<TEventArgs>> FromEventPattern<TEventArgs>(Action<EventHandler<TEventArgs>> addHandler, Action<EventHandler<TEventArgs>> removeHandler)
#if SILVERLIGHT
 where TEventArgs : EventArgs
#endif
		{
			Contract.Requires(addHandler != null, null, "addHandler != null");
			Contract.Requires(removeHandler != null, null, "removeHandler != null");
			Contract.Ensures(Contract.Result<IObservable<EventPattern<TEventArgs>>>() != null, null, "Contract.Result<IObservable<EventPattern<TEventArgs>>>() != null");
			return null;
		}

		public static IObservable<EventPattern<EventArgs>> FromEventPattern(Action<EventHandler> addHandler, Action<EventHandler> removeHandler)
		{
			Contract.Requires(addHandler != null, null, "addHandler != null");
			Contract.Requires(removeHandler != null, null, "removeHandler != null");
			Contract.Ensures(Contract.Result<IObservable<EventPattern<EventArgs>>>() != null, null, "Contract.Result<IObservable<EventPattern<EventArgs>>>() != null");
			return null;
		}

		public static IObservable<EventPattern<TEventArgs>> FromEventPattern<TDelegate, TEventArgs>(Action<TDelegate> addHandler, Action<TDelegate> removeHandler)
#if SILVERLIGHT
 where TEventArgs : EventArgs
#endif
		{
			Contract.Requires(addHandler != null, null, "addHandler != null");
			Contract.Requires(removeHandler != null, null, "removeHandler != null");
			Contract.Ensures(Contract.Result<IObservable<EventPattern<TEventArgs>>>() != null, null, "Contract.Result<IObservable<EventPattern<TEventArgs>>>() != null");
			return null;
		}

		public static IObservable<EventPattern<TSender, TEventArgs>> FromEventPattern<TDelegate, TSender, TEventArgs>(Action<TDelegate> addHandler, Action<TDelegate> removeHandler)
#if SILVERLIGHT
 where TEventArgs : EventArgs
#endif
		{
			Contract.Requires(addHandler != null, null, "addHandler != null");
			Contract.Requires(removeHandler != null, null, "removeHandler != null");
			Contract.Ensures(Contract.Result<IObservable<EventPattern<TSender, TEventArgs>>>() != null, null, "Contract.Result<IObservable<EventPattern<TSender, TEventArgs>>>() != null");
			return null;
		}

		public static IObservable<EventPattern<TEventArgs>> FromEventPattern<TEventArgs>(object target, string eventName)
#if SILVERLIGHT
 where TEventArgs : EventArgs
#endif
		{
			Contract.Requires(target != null, null, "target != null");
			Contract.Requires(eventName != null, null, "eventName != null");
			Contract.Ensures(Contract.Result<IObservable<EventPattern<TEventArgs>>>() != null, null, "Contract.Result<IObservable<EventPattern<TEventArgs>>>() != null");
			return null;
		}

		public static IObservable<EventPattern<EventArgs>> FromEventPattern(object target, string eventName)
		{
			Contract.Requires(target != null, null, "target != null");
			Contract.Requires(eventName != null, null, "eventName != null");
			Contract.Ensures(Contract.Result<IObservable<EventPattern<EventArgs>>>() != null, null, "Contract.Result<IObservable<EventPattern<EventArgs>>>() != null");
			return null;
		}

		public static IObservable<EventPattern<TSender, TEventArgs>> FromEventPattern<TSender, TEventArgs>(object target, string eventName)
#if SILVERLIGHT
 where TEventArgs : EventArgs
#endif
		{
			Contract.Requires(target != null, null, "target != null");
			Contract.Requires(eventName != null, null, "eventName != null");
			Contract.Ensures(Contract.Result<IObservable<EventPattern<TSender, TEventArgs>>>() != null, null, "Contract.Result<IObservable<EventPattern<TSender, TEventArgs>>>() != null");
			return null;
		}

		public static IObservable<EventPattern<EventArgs>> FromEventPattern(Type type, string eventName)
		{
			Contract.Requires(type != null, null, "type != null");
			Contract.Requires(eventName != null, null, "eventName != null");
			Contract.Ensures(Contract.Result<IObservable<EventPattern<EventArgs>>>() != null, null, "Contract.Result<IObservable<EventPattern<EventArgs>>>() != null");
			return null;
		}

		public static IObservable<EventPattern<TEventArgs>> FromEventPattern<TEventArgs>(Type type, string eventName)
#if SILVERLIGHT
 where TEventArgs : EventArgs
#endif
		{
			Contract.Requires(type != null, null, "type != null");
			Contract.Requires(eventName != null, null, "eventName != null");
			Contract.Ensures(Contract.Result<IObservable<EventPattern<TEventArgs>>>() != null, null, "Contract.Result<IObservable<EventPattern<TEventArgs>>>() != null");
			return null;
		}

		public static IObservable<EventPattern<TSender, TEventArgs>> FromEventPattern<TSender, TEventArgs>(Type type, string eventName)
#if SILVERLIGHT
 where TEventArgs : EventArgs
#endif
		{
			Contract.Requires(type != null, null, "type != null");
			Contract.Requires(eventName != null, null, "eventName != null");
			Contract.Ensures(Contract.Result<IObservable<EventPattern<TSender, TEventArgs>>>() != null, null, "Contract.Result<IObservable<EventPattern<TSender, TEventArgs>>>() != null");
			return null;
		}

		public static IObservable<EventPattern<TEventArgs>> FromEventPattern<TDelegate, TEventArgs>(Func<EventHandler<TEventArgs>, TDelegate> conversion, Action<TDelegate> addHandler, Action<TDelegate> removeHandler)
#if SILVERLIGHT
 where TEventArgs : EventArgs
#endif
		{
			Contract.Requires(conversion != null, null, "conversion != null");
			Contract.Requires(addHandler != null, null, "addHandler != null");
			Contract.Requires(removeHandler != null, null, "removeHandler != null");
			Contract.Ensures(Contract.Result<IObservable<EventPattern<TEventArgs>>>() != null, null, "Contract.Result<IObservable<EventPattern<TEventArgs>>>() != null");
			return null;
		}
	}
}